function[] = plotAlgorithmComparison(average_kNN2, average_kNN6, average_mahal2, average_mahal6, average_percep2, average_percep6)

    average_kNN2 = mean(average_kNN2, 1);
    average_kNN6 = mean(average_kNN6, 1);
    average_mahal2 = mean(average_mahal2, 1);
    average_mahal6 = mean(average_mahal6, 1);
    
    figure;
    subplot(2,1,1);
    bar(1:3, [average_kNN2; average_mahal2; average_percep2]);
    axis([0.3 6 40 100]);
    title('2 class problem');
    ylabel('% correct classification');
    set(gca,'XTick',1:3,'XTickLabel',{'kNN','mahalanobis','perceptron'});
    legend('AllSelection', 'BestSelection 2 Classes', 'BestSelection 6 Classes', 'BestSelection', 'RandomSelection');
    
    subplot(2,1,2);
    bar(1:3, [average_kNN6; average_mahal6; average_percep6]);
    axis([0.3 6 40 100]);
    title('6 class problem');
    ylabel('% correct classification');
    set(gca,'XTick',1:3,'XTickLabel',{'kNN','mahalanobis','perceptron'});
    legend('AllSelection', 'BestSelection 2 Classes', 'BestSelection 6 Classes', 'BestSelection', 'RandomSelection');
end